package com.hnhcyy.goods.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.hnhcyy.goods.pojo.Leibie2;
import com.hnhcyy.goods.service.Leibie2Service;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

@Api(value="/Leibie2Api", tags= "商品类别接口")
@RestController
@RequestMapping("/category")
public class Leibie2Api {
	
	@Autowired
	private Leibie2Service leibie2Service;
	
	
	/**
	 * 根据商家ID获取所有类别
	 * @author sheyongjun
	 * @date 2019年1月19日
	 */
	@ApiOperation(value = "获取所有类别", notes = "根据商家ID获取所有类别")
	@ApiImplicitParam(name = "sjid", value = "商家ID", required = true, dataType = "int",paramType = "query")
	@GetMapping("/list")
	public List<Leibie2> list(@RequestParam(defaultValue="1") int sjid){
		return leibie2Service.getListBySjid(sjid);
	}
	
	
}
